import java.util.Scanner;

/**
 * @version v1.0
 * @author} feige
 * @date 2021-11-30-16:14
 * @description
 */
public class Add {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入要计算到哪个数的最终结果：");
        int count = scanner.nextInt();
        int sum = 0;
        for (int i = 1; i <= count; i++) {
            if (i % 2 == 0) {
                sum -= i;
            } else {
                sum += i;
            }
        }
        System.out.println("结果：" + sum);
    }
}
